#ifndef ASPRITE_INSTANCE_H
#define ASPRITE_INSTANCE_H

class ASprite;

class ASpriteInstance
{
	public:	
		ASpriteInstance();
		~ASpriteInstance();

		void Stop();

		void SetAnim(int anim, int loop = 0xFFFFFF);
		void SetPosition(int x, int y);
		void SetASprite(ASprite* sprite);

		int GetCurrentAnim() { return m_nCurrentAnim; }

		void StartAnim(ASprite* sprite, int anim, int x, int y, int loop = 0xFFFFFF);

		void SetTransitionAnim(int anim, int nextAnim);

		bool IsAnimEnded();

		void Update();
		void Draw();

		void Draw3D(const irr::core::vector3df& pos);

		ASprite* GetASprite () const { return m_nCurrentSprite; }

		void SetScale (float x, float y) { m_scaleX = x; m_scaleY = y; }

	protected:
		int x;
		int y;

		int m_nCurrentAnim;
		int m_nCurrentAFrame;
		int m_nCurrentFTime;
		int m_nCurrentAnimTime;
		int m_nLoop;

		int m_nNextAnim;

		ASprite* m_nCurrentSprite;

		irr::u32 m_nLastUpdateTime;
		float m_scaleX;
		float m_scaleY;
};

#endif //ASPRITE_INSTANCE_H